﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using XYW.WebSite;

namespace xyw.admincp
{
    public partial class Cache : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                BindData();
        }

        private void BindData()
        {
            lt_Num.Text = HttpRuntime.Cache.Count.ToString();
            IDictionaryEnumerator CacheEnum = HttpRuntime.Cache.GetEnumerator();
            StringBuilder str = new StringBuilder();
            while (CacheEnum.MoveNext())
            {
                str.Append("<li>缓存名: <b>[" + CacheEnum.Key + "]</b></li>");
            }
            lt_Cont.Text = str.ToString();
        }

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            XYW.WebSite.RuntimeCache.Clear();
            BindData();
        }
    }
}